package jk.zmn.sorm.bean;

import java.util.List;
import java.util.Map;

/**
 * @author 张梦楠
 * @简书：https://www.jianshu.com/u/d611be10d1a6
 * @码云：https://gitee.com/zhangqiye/events
 * @Date: 2018/6/14
 *
 *  封装表信息
 *  表名
 *  字段信息
 *  主键
 *
 **/
public class TableInfo {

    /**
     * 表名
     */
    private String name;
    /**
     * 存放字段信息， 字段名和字段信息
     */
    private Map<String,ColumnInfo> columns;
    /**
     * 主键信息
     */
    private ColumnInfo onlyPriKey;
    /**
     * 联合主键
     */
    private List<ColumnInfo> priKeys;

    public TableInfo(String name, Map<String, ColumnInfo> columns, List<ColumnInfo> priKeys) {
        this.name = name;
        this.columns = columns;

        this.priKeys = priKeys;
    }

    public List<ColumnInfo> getPriKeys() {
        return priKeys;
    }

    public void setPriKeys(List<ColumnInfo> priKeys) {
        this.priKeys = priKeys;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Map<String, ColumnInfo> getColumns() {
        return columns;
    }

    public void setColumns(Map<String, ColumnInfo> columns) {
        this.columns = columns;
    }

    public ColumnInfo getOnlyPriKey() {
        return onlyPriKey;
    }

    public void setOnlyPriKey(ColumnInfo onlyPriKey) {
        this.onlyPriKey = onlyPriKey;
    }

    public TableInfo() {
    }

    public TableInfo(String name, Map<String, ColumnInfo> columns, ColumnInfo onlyPriKey) {
        this.name = name;
        this.columns = columns;
        this.onlyPriKey = onlyPriKey;
    }
}
